Skip to main content

Datasets

Datasets are a powerful feature that enable the data-driven testing by executing the test cases with multiple sets of test data. They provide flexibility for creating the environment-specific datasets and they support to import the test data from the CSV files, which makes the test automation more efficient and maintainable.

Creating Datasets

Image description

Import from CSV File

  1. In a test case, go to the "Datasets" section.
  2. Click the "Create Dataset" button.
  3. Select "Import from Local System". Image description
  4. Provide a name for the dataset.
  5. Drop your CSV file or click 'Click Here' to upload.
  6. Click "Create" to import the data. Image description

Manual Creation

  1. Navigate to the "Datasets" section in your test case.
  2. Click "Create Dataset" button.
  3. Select "Create from Scratch".
  4. Provide a name and click create. Image description
  5. Add rows and columns using the respective buttons.
  6. Enter your test data.
  7. Click Save to store the dataset. Image description

Environment-Specific Datasets

To create an environment-specific variations for your datasets, do these steps below:

  1. Click "Add" button next to the name. Image description
  2. Select the environment variable name.
  3. Assign environment-specific values. Image description

During the execution of the test, if an environment-specific data exists, it will be used or else a default dataset will be taken.

Using Dataset Variables

  • In request fields (URL, parameters, headers): Use {{variable_name}}.
  • In scripts: Use pq.iterationData.get("variable_name").

Running Tests with Datasets

There are two methods to execute the test with Datasets as given below:

  1. On the Dataset page, click on the "Run" button.
  2. Run the test case normally - variables will be automatically taken from the dataset.

The test will run once for each dataset row, using the row's values as variables.